//
//  PhoneTool.m
//  MedicalClient
//
//  Created by H on 2018/5/2.
//  Copyright © 2018年 com.YouCanSee.xiaohan. All rights reserved.
//

#import "PhoneTool.h"

@implementation PhoneTool
+(void)makeAphoneCall:(NSString *)phoneNum{
    NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@", phoneNum];
    if (@available(iOS 10.0, *)) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil];
    } else {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
    }
}

+ (void)copyStr:(NSString*)str{
    if (str && str.length) {
        UIPasteboard *pab = [UIPasteboard generalPasteboard];
        [pab setString:str];
        if (pab == nil) {
            [[kAppDelegate getCurrentVC].view  makeToast:XLocalized(@"复制失败!")];
        }else
        {
            [[kAppDelegate getCurrentVC].view makeToast:XLocalized(@"复制成功!")];
        }
    }
   
}
@end
